using System;
using System.Data;
using System.Collections.Generic;
namespace eTMS.DAO{
	/********************************BEGIN ThiSinhMonThiDAO****************************************/
	///<summary>
	/// <para>Author: Auto generated class by CSharp Code Generator v2.0</para>
	/// <para>Date:04/09/2010 42:05:29</para>
	/// <para>Class Name: ThiSinhMonThiDAO</para>
	/// <para>Description: Class access to table ThiSinhMonThi in database. Class for coder code here</para>
	///</summary>

	
	public partial class ThiSinhMonThiDAO{
        public DataSet SelectAllDSWithThiSinhByMonThi_ID(int MonThi_ID)
        {
            IDbCommand cmd = this.CreateCommand();
            cmd.CommandText = @"SELECT   SinhVien.SinhVien_ID,  SinhVien.MaSinhVien, SinhVien.TenSinhVien, SinhVien.DiaChi, SinhVien.Email, SinhVien.SoCMND, SinhVien.DienThoai, SinhVien.GhiChu, SinhVien.GioiTinh, 
                                         SinhVien.NgaySinh, ThiSinhMonThi.ThiSinhMonThi_ID, ThiSinhMonThi.SoBaoDanh, ThiSinhMonThi.MonThi_ID, Lop.MaLop, Lop.TenLop, NganhHoc.MaNganhHoc, 
                                         NganhHoc.TenNganhHoc, Khoa.MaKhoa, Khoa.TenKhoa, ThiSinhMonThi.DiemThi, ThiSinhMonThi.TrangThai, 
                                         ThiSinhMonThi.PhongThi_ID, KhoaHoc.MaKhoaHoc, KhoaHoc.TenKhoaHoc,PhongThi.MaPhongThi
                                FROM            SinhVien INNER JOIN
                                         ThiSinhMonThi ON SinhVien.SinhVien_ID = ThiSinhMonThi.SinhVien_ID INNER JOIN
                                         LopSinhVien ON SinhVien.SinhVien_ID = LopSinhVien.SinhVien_ID INNER JOIN
                                         Lop ON LopSinhVien.Lop_ID = Lop.Lop_ID INNER JOIN
                                         PhanNganhSinhVien ON SinhVien.SinhVien_ID = PhanNganhSinhVien.SinhVien_ID INNER JOIN
                                         NganhHoc INNER JOIN
                                         Khoa ON NganhHoc.Khoa_ID = Khoa.Khoa_ID ON PhanNganhSinhVien.NganhHoc_ID = NganhHoc.NganhHoc_ID INNER JOIN
                                         KhoaHoc ON PhanNganhSinhVien.KhoaHoc_ID = KhoaHoc.KhoaHoc_ID
                                         LEFT JOIN PhongThi ON ThiSinhMonThi.PhongThi_ID=PhongThi.PhongThi_ID
                                WHERE ThiSinhMonThi.MonThi_ID=" + MonThi_ID.ToString();
            return this.SelectDS(cmd);
        }

	}
	/*****************************************************************************************************/
	/**********************************END ThiSinhMonThiDAO*****************************************/
	/*****************************************************************************************************/
}

